<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
	<head>
		<title><?php echo (L("_WEB_TITLE")); ?></title>
		<meta charset="UTF-8">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<!-- intoHead  -->
		<link rel="stylesheet" type="text/css" href="<?php echo C('BOOTSTRAP');?>css/bootstrap.min.css?v=<?php echo C('VERSION');?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HOME_CSS');?>console.css?v=<?php echo C('VERSION');?>" />
		<script type="text/javascript" src="<?php echo C('HOME_JS');?>jquery-2.0.3.min.js?v=<?php echo C('VERSION');?>"></script>
		<script type="text/javascript" src="<?php echo C('HOME_JS');?>index.js?v=<?php echo C('VERSION');?>"></script>
		<script language="JavaScript" src="<?php echo C('LAYERUI');?>layui.js?v=<?php echo C('VERSION');?>"></script>
		<script language="JavaScript" src="<?php echo C('HOME_JS');?>function.js?v=<?php echo C('VERSION');?>"></script>
		<script>
		layui.use(['layer','form'], function(){
			var layer=layui.layer;
			var form =layui.form();
		});
		</script>
		<link rel="stylesheet" type="text/css" href="<?php echo C('HOME_CSS');?>iframe.css?v=<?php echo C('VERSION');?>" />
		<script>
			var city_url = "<?php echo C('HOME_JS');?>city.min.js";
		</script>
		<script type="text/javascript" src="<?php echo C('HOME_JS');?>jquery.cityselect.js"></script>
		<script type="text/javascript" src="<?php echo C('UPLOAD');?>jquery.form.js"></script>
		
	</head>
<body class="iframe-body">

 <div style="text-indent:10px;background:#EAEDF1;width:100%;position:fixed;top:0px;height:35px;line-height:35px;">
    <img style="position:relative;top:-2px;" src="<?php echo C('HOME_IMAGE');?>icon/sy_icon.png" width="15px;">
    <?php echo (L("_HOME_PAGE")); ?>
    &gt;
    <?php echo ($nav1); ?>
    &gt;
    <span style="color:#15b6be;"><?php echo ($nav2); ?></span>
    <span style="float:right;margin-right:10px;cursor:pointer;" onclick="location.reload()"><?php if((LANG_SET) == "zh-cn"): ?>刷新<?php else: ?>refresh<?php endif; ?></span>
</div>
<div class="body">
<button type="button" style="margin:0px;" class="btn btn-primary" id="add_group"><?php echo (L("_ADD")); echo (L("_GROUP")); ?></button>
<table class="table table-bordered" style="margin-top:5px;">
	<tr class="active">
		<th><?php echo (L("USER_NUM")); ?></th><th><?php echo (L("_GROUP")); ?></th><th><?php echo (L("USER_ACTION")); ?></th>
	</tr>
	<?php if(is_array($group)): $i = 0; $__LIST__ = $group;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
		<td><?php echo ($vo["id"]); ?></td><td><?php echo ($vo["name"]); ?></td><td><span group_id="<?php echo ($vo["id"]); ?>" class="quanxian pointer"><?php echo (L("_PERMISSION_SET")); ?></span></td>
	</tr><?php endforeach; endif; else: echo "" ;endif; ?>
</table>
<div class="page"><?php echo ($page); ?></div>
</div>
<script>
  var html ='<input class="layui-input" type="text" id="group_name">';
  $('#add_group').click(function(){
	parent.layer.open({
		  title:'<?php echo (L("_ADD")); echo (L("_GROUP")); ?>',
		  btn:['<?php echo (L("_SURE")); ?>','<?php echo (L("_CANCEL")); ?>'],
		  content: html,
		  yes: function(index, layero){
		    var value = $('#group_name').val();
		    if(!value){
		    	layer.msg('<?php echo (L("_INPUT_GROUP_NAME")); ?>');
		    	return false;
		    }
		    var data = {name:value};
		    $.post("<?php echo U('Ajax/add_group');?>",data,function(r){
		    	if(r.code == 1){
		    		parent.layer.msg('<?php echo (L("_SUCCESS")); ?>',{time:1000},function(){
		    			location.reload();
		    		})
		    	}else{
		    		parent.layer.msg('<?php echo (L("_FAIL")); ?>')
		    	}
		    })
		  }
	})  
  })
  $('.table').on('click','.quanxian',function(){
	  var group_id = $(this).attr('group_id');
	  parent.layer.open({
		  title:['设置权限','font-weight:bold'],
		  type:2,
		  shadeClose:true,
		  area: ['600px', '500px'],
		  content: "<?php echo U('Qxgl/caidan_html');?>?group_id="+group_id,
	  })
  })
</script>